<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人中心</title>
<link type="text/css" rel="stylesheet" href="{$css_path}/css.css"/>
<link type="text/css" rel="stylesheet" href="{$css_path}/global.css"/>
<link rel="stylesheet" href="{$css_path}/powerFloat.css" type="text/css" />
</head>
<body>
{include file="header.html"}
<div id="wrapper">
  <div id="content">
    <div id="con_le">{include file="user_nav.html"} 
    </div>
    <!--con_le over-->
    <div id="con_box">
      <div class="Current">{$position}</div>
      <div class="con_top">
        {include file="user_common_detail.html"}
        <div class="clear"></div>
      </div>
      <div id="user_content">
       {include file="message.html"}
        <form name="myform" action="{$site_url}user/base/profile" method="post" id="myform">
          <fieldset>
            <legend>基本信息</legend>
            <table width="100%" class="table_form">
              <tr>
                <td width="80" height="30">用户名：</td>
                <td>{$data.username}</td>
              </tr>
              <tr>
                <td>电子邮箱：</td>
                <td>{$data.email}</td>
              </tr>
              <tr>
                <td>用户组：</td>
                <td>{$data.group_name}</td>
              </tr>
              
              <tr id='tr_user'>
                  <td>昵称：</td>
                  <td>
                      <input type='text' name='nickname' id='nickname' value='{$data.nickname}' class='text small'/>
                  </td>    			
              </tr>
              <tr>
                <td>真是姓名：</td>
                <td><input type="text" name="realname"  value="{$data.realname}" class="text small" >
                  </input></td>
              </tr>
              <tr >
                <td>出生日期：</td>
                <td><input type="text" name="birthday"  value="{$data.birthday}" class="text small Wdate"  onClick="WdatePicker({minDate:'1950-01-01',maxDate:'2000-01-01'})">
                  </input></td>
              </tr>
              <tr id='tr_gender'>
                <td>性别：</td>
                <td><input type='radio' name='sex' value='1' id='gender_1' {if $data.sex ==1}checked{/if}/>
                  <label for='gender_1'>男</label>
                  &nbsp;&nbsp;&nbsp;
                  <input type='radio' name='sex' value='2' id='gender_2'  {if $data.sex ==2}checked{/if}/>
                  <label for='gender_2'>女</label></td>
              </tr>
              <tr id='tr_area'>
                <td>居住地区：</td>
                <td><select name="province" id="province_id">
                    <option value=''>--请选择省份--</option>
                     
                                                        {foreach from=$province item=p}
                                                        
                    <option value='{$p.id}' {if $data.province == $p.id}selected='selected'{/if}>{$p.name}</option>
                    
                                                        {/foreach}
                                                    
                  </select>
                  <span id="sub_id">
                  <select name='city'>
                    
                                                            {foreach from=$city item=c}
                                                            
                    <option value="{$c.id}" {if $data.city == $c.id}selected='selected'{/if}>{$c.name}</option>
                    
                                                            {/foreach}
                                                        
                  </select>
                  </span></td>
              </tr>
              <tr>
                <td>自我简介：</td>
                <td><textarea  style="width:80%;height:46px;"  name="description">{$data.description}</textarea></td>
              </tr>
              <tr align="center">
                <td colspan="2" style="text-align:center"><input type="submit" class="button-blue" value="提 交"></td>
              </tr>
            </table>
          </fieldset>
        </form>
      </div>
    </div>
    <!--con_box over-->
    <div class="clear"></div>
  </div>
  <!--content over--> 
</div>
{include file="footer.html"}
{include file="hidden_div.html"} 
<script type="text/javascript" src="{$js_path}/jquery.js"></script> 
<script type="text/javascript" src="{$js_path}/jquery-powerFloat.js"></script> 
<script type="text/javascript" src="{$js_path}/jquery.pngfix.js"></script> 
<script type="text/javascript" src="{$js_path}/scrolltopcontrol.js"></script> 
<script type="text/javascript" src="{$js_path}/myfloat.js"></script> 
<script type="text/javascript" src="{$js_path}/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="{$js_path}/My97DatePicker/jquery.validate.js"></script>
<script type="text/javascript" src="{$js_path}/message.js"></script> 
<script type="text/javascript" src="{$js_path}/user.js"></script> 
<script>
$(function(){
	//修改某一个省的城市列表
	$('#province_id').change(function(){
		$.ajax({
			url:"{$site_url}ajax/sub_area",
			type:'post',
			data:'id='+$(this).val(),
			dataType:'json',
			success:function(data){
				$('#sub_id').html('');
				if(data != ''){
					var html = "<select name='city'>";
					$.each(data,function(i,n){
						 html +="<option value='"+n.id+"'>"+n.name+"</option>";
					});
					html +="</select>";
					$('#sub_id').html(html);
				}
			}
		});
	});
	
	//验证用户输入
	 $(function(){
		$("#myform").validate({
			rules: {
				sex: "required",
				province: "required"
			},
			messages: {
				sex: "请选择性别!",
				province: "请选择所在地!"
			}
		});
	})
});
</script>
</body>
</html>
